package com.shouhe.mysap.config;

import com.shouhe.mysap.intercept.LoginIntercept;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 守鹤
 * @date 2020/5/31 22:11
 */
@Configuration
public class SpringMvcConfig {

    @Bean
    public WebMvcConfigurer getWebMvcConfigurer() {
        return new WebMvcConfigurer() {
            @Override
            public void addInterceptors(InterceptorRegistry registry) {
                registry.addInterceptor(new LoginIntercept())
                        .addPathPatterns("/**")
                        .excludePathPatterns("/common/**","/easyui/**","/h-ui/**","/image/**","/system/login","/error","/system/getVerifiCodeImage");
            }
        };
    }

}
